package com.smart.wap.bodys;

import com.smart.common.entities.domain.SmartPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author leo
 * @date 2023/09/25
 */
public class WorkLoginBody {

    @Data
    @ApiModel("WorkLoginBody1")
    public static class LoginBody implements Serializable {


        @ApiModelProperty(value = "手机号", required = true)
        @NotBlank(message = "手机号 不能为空")
        @Pattern(regexp = SmartPattern.PHONE, message = "手机号码 格式不正确")
        private String phone;

        @ApiModelProperty(value = "密码",  required = true)
        private String password;

    }

    @Data
    @ApiModel("WorkLoginBody2")
    public static class authCodeBody implements Serializable {

        @ApiModelProperty(value = "手机号", required = true)
        @NotBlank(message = "手机号 不能为空")
        @Pattern(regexp = SmartPattern.PHONE, message = "手机号码 格式不正确")
        private String phone;

    }
    @Data
    @ApiModel("WorkLoginBody3")
    public static class authCodeLoginBody implements Serializable {

        @ApiModelProperty(value = "手机号", required = true)
        @NotBlank(message = "手机号 不能为空")
        @Pattern(regexp = SmartPattern.PHONE, message = "手机号码 格式不正确")
        private String phone;

        @ApiModelProperty(value = "验证码", required = true)
        @NotBlank(message = "验证码 不能为空")
        private String authCode;

        @ApiModelProperty(value = "openId", required = true)
        @NotBlank(message = "openId 不能为空")
        private String openId;

    }

    @Data
    @ApiModel("WorkLoginBody4")
    public static class RefreshTokenBody implements Serializable {

        @ApiModelProperty(value = "refreshToken 字符串", required = true)
        @Length(max = 32, message = "refreshToken 格式错误")
        @Pattern(regexp = SmartPattern.MD5, message = "refreshToken 令牌格式不正确")
        private String refreshToken;

    }
}
